erplogobit.JPG (7484 bytes)

June 1999, Technology Corner
by Rob Hirschfeld

XML: Building a bridge

        Plus Sidebars: So what is XML? and How is XML used?

        Other XML Resources

The Internet has a history of enthusiastically heralding new technologies before they are practical tools. So I was skeptical when I first heard about eXtensible Markup Language or XML, but I was surprised when I started digging. XML has genuine potential to fundamentally improve the way we use computers.

XML's value is that it fills some problematic gaps in mainstream technologies in a very flexible and effective way. In the last 5 years we have seen client/server architecture mature and become the dominant paradigm for applications; consequently, computer uses today have many ways to efficiently store or access tremendous amounts of information. However, until XML arrived, actually sharing information between applications was usually both challenging and prohibitively expensive.

Let's start from the beginning

Relational Database servers and Web servers, two prime examples of client/server technology, have fundamentally changed the way software is developed and information distributed. They have had such an impact on our society that phrases like "search the database", "the server is down," and "surf the net" have moved from jargon into the mainstream lexicon.

Database and Web servers share the objective to let users store and access information; however, they each meet this objective differently. Database servers are like electronic vaults: they are optimized for efficient storage and to retrieve vast amounts of tightly linked data but weak on distributing and formatting the information. Web servers offer the opposite strengths: they are highly specialized to share information in a readable format but lack tools for managing complex and inter-related data.

XML fills the data gap

Traditionally, information exchanges between computers have been cumbersome. Most systems that are described as "integrated" really just exchange information as very simple files. These files are commonly called "flat files" because all the data relationships stored in the database were removed from the data file to make it easier to handle. Unfortunately, the cost of easy import and export of data is that getting good information from flat files is like making orange juice with just the rind: someone already removed the valuable part.

XML provides a distinct advantage over flat files because it is designed to maintain not just data but the relationships between data elements. These relationships are a fundamental part of the way information is stored on a Database server. Without XML, it is difficult to preserve the relationships while detaching data from the server.

XML maintains data relationships because it provides a structure for information in the same way that we use grammar to structure words in sentences. In fact, XML's method for structuring data is called a Grammar because it describes how the information in an XML file fits together. This means that within an XML document each element has a place and the place is an important as the data.

For example, the meaning of an English word like "slip" is meaningless without a context. Do we mean a verb ("I made a slip in conversation" or "I slip on ice") or a noun ("he just got a pink slip" or "she is wearing a pink slip")? Context and relationships are critical to interpreting meaning from data.

Just like in language, XML grammars can be varied and adapted to many situations. For example, XML documents can nest data into parent-child sets like an outline or they can be used to describe the relationships between atoms in chemical equations. XML can even store relationships that are too complex to be efficiently maintained by traditional relational databases.

 

So what is XML?

XML is a mark-up language that is actually just a subset of the existing Internet definition for Standard Generalized Markup Language or SGML, which has been around since 1986 (yes, eighty-six). A mark-up language definition describes a way for adding hidden information into a file. Hyper-Text Markup Language or HTML, the markup language behind most web pages, is really just a way of embedding formatting instructions into a text file. XML uses the same mark-up concepts as HTML, except that it's goal is to format data instead of display it.

A simple XML file for storing contacts data looks like this:

<contacts dataset>
<record itemid="001">
<name>Rob Hirschfeld</name>
<company>Hirschfeld Consulting</company>
<phone>504-780-7971</phone>
</record>
<record itemid="002">
<name>Dave Turbide</name>
<company>MFG Publishing</company>
<phone>978-922-4782</phone>
</record>
</contacts dataset>

The beauty of a mark-up language like XML is its simplicity and flexibility. Creating or finding information in XML is trivial and follows very clear rules. It is also flexible because new tags (the descriptive information between the greater than and less than symbols) or levels of information can be added as needed. For example, if I wanted to include multiple phone numbers per record in the example it could look like this:

...
<phone>
<voice>504-780-7971</voice>
<fax>504-555-1000</fax>
<cell>504-555-2000</cell>
<pager>504-555-3000</pager>
</phone>
...

This extensibility makes XML unique and very powerful: so it is no surprise that XML stands for eXtensible Markup Language.

XML also solves flat files' extreme sensitivity to changes in field order and text formatting. Each element in an XML document is explicitly tagged. This tagging ensures that every XML element can be correctly interpreted even if the element order or grouping changes. This redundancy expands the size XML files, but this is not an issue because XML is not intended to store multi-Gigabyte data sets like a Database server.

Let's Exchange Information!

Just 3 years ago exchanging information was internally focused. It meant synchronization between programs inside your company and occasionally electronic data interchange (EDI). The explosion of the Internet changed the rules because the Internet is all about information exchange. Companies are finding that making a web site profitable means providing visitors with useful and dynamic information instead of static text and glitzy graphics.

The information you provide visitors at your web site is just one of the ways that Internet links your business to the world. Information flows to and from your business in the form of web and email transactions that have become mission critical to your operations. Cumbersome, timer driven synchronization using flat files integration is not acceptable to customers hitting your web site for current order status or to your materials manager planning tomorrow's just-in-time inventory levels.

XML is smarter!

XML designers learned from mistakes made with the core language of web pages, HTML. We are using HTML in ways its designers never imagined. This means that HTML documents today require workarounds to handle routine tasks like Search Engine flags, JavaScript support, and object embedding. In many cases these workarounds are browser dependant or marginally adopted by the developer community. Consequently, the web is a very difficult place to innovate, and large segments of your potential audience may not be able to use cutting edge features.

XML has been designed to avoid these issues. It provides built-in flexibility to adapt to specific needs and has the ability to define and then enforce a structure. This means that XML documents can be self-correcting to ensure that the information they store makes sense. XML enforces the structure using an optional format known as a Document Type Definition (DTD). Clearly defined rules help developers contribute in a consistent and repeatable way so they can present data in predictable formats.

Ultimately, these improvements in Internet development will enhance users' experiences: Search Engines will be smarter, information presentation will be clearer and more adaptable, companies will find it easier to keep information current, and development costs will be reduced.

How is XML used?

XML is not an application; it is a data file format. This is a critical distinction because users work with applications (programs), not data files. This means XML applications require additional tools and components to bring them to life. As more applications use XML, I expect the hype over the standard to fade and be replaced by hype over XML applications. In real terms, XML is no more exciting than existing data access standards ODBC, JDBC, or OLEDB.

The figure below illustrates how an application (or app.) merges two views of data, meta-data and index, to make a large data file practical to the user. The meta-data tells the application how the data is formatted and describes the relationships within the data. The index allows the application to efficiently find, control, and modify specific items within the data.

While data can be stored in almost any format, XML's strength is its ability to provide a simple, yet versatile and powerful meta-data structure. This means that an application does less work, and makes fewer mistakes, trying to understand the data.

The key to an XML application is a component known as a parser. The parser's job is to read an XML data file, interpret the file's meta-data, and create an index for all the data. The parser is the true heart of an XML application because the user accesses the parser, not the XML file, when she views or edits information.

XML parsers offer a broad range of functionality and features. Some parsers simply store XML for quick access; others can enforce complex rules defined in an XML Document Type Definition (DTD). In the future, I expect to see XML parsers embedded into operating systems and applications. Embedding XML parsers into applications and XML into files format is an important step towards truly transparent data integration.

XML by itself does not provide all these benefits. It is just a foundation for other technologies. For example, XML architects have already designed ways to embed XML into HTML to make it easier to format web documents. Even though the W3C Committee just released XML specification version 1.0, there are already several competing style standards: Cascading Style Sheets (CSS), Document Style Semantics and Specification Language (DSSSL), and Extensible Style Language (XSL).

To actually use XML for development, developers must use a special browser object called an XML Parser. Just like style standards, the Internet already market offers many XML Parser flavors from both big names (Microsoft and Sun) down to obscure Internet Startups. Please read the XML sidebar for more information about XML applications.

What is the price?

XML is not without a price. For XML to blossom, we must compromise some of the web's greatest strengths: extreme ease of use and lightweight browsers. I once heard HTML described as easy enough for a high school student to write. Unfortunately, the result of merging XML and HTML will require page authors to write using sophisticated like FrontPage or Office2000 (which supports XML on HTML as a native format).

XML will also close the books on simple browsers, because XML requires the browser to be smart enough to handle raw data, special processing, and complex memory management. In addition XML browsers must support an object model and use client side JavaScript or VBScript. This type of browser is much more complex and lacks the reliability that has made the web so ubiquitous.

In addition, security issues lurk behind the nirvana of highly interconnected companies. What is the potential impact of a total database breach considering the fury that has been raised over relatively benign topics like browser cookies and collecting registration identifiers?

The ugly truth is that it will be years before we truly have the real security infrastructure that people assume already exists. Most information is protected because so few people know where to look (a.k.a.: "security by obscurity), but what happens when we start to make data easy to find, access, and interpret?

Where is XML now?

XML is still in the early stages of acceptance. I anticipate early adoption of XML for Intranets (internal webs), and Extranets (non-public, privileged access webs) because these forums can guarantee a minimum standard from their clients. In addition, these two environments are much more secure and allow companies to test the waters with less risk.

The client/server model has improved productivity in the workplace; but substantial hurdles remain in actually integrating information between servers. These problems will not be solved overnight. We are still facing issues on technology acceptance, definition of standards, and improving security. However, I see XML is a key to solving the problems that plague Web sites and Business to Business (B2B) eCommerce today.

Back to the top | Other XML Resources

Interested in reading more?  Click here for more articles.

Originally appeared in Midrange ERP, June 1999. Used with permission.